<%--
  Created by IntelliJ IDEA.
  User: 路帅
  Date: 2021/8/2
  Time: 10:48
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script>
        function sendTo() {
            window.location.href = "/show";
        }
    </script>
    <style type="text/css">
        tr {
            line-height: 3em;
            text-align: center;
            color: #02d53d;
        }

        td {
            word-spacing: 4em;
        }
    </style>
</head>
<body>

<form method="post" action="/show?cmd=updateOrSave">
    <table cellspacing="0" cellpadding="0" width="50%" align="center">
        <h3 align="center">请录入商品信息</h3>
        <tr>
            <td colspan="2"><input type="hidden" name="id" value="${p.id}"></td>
        </tr>
        <tr>
            <td>商品名：<input type="text" name="productName" value="${p.productName}"></td>
            <td>分类编号：<input type="number" name="dir_id" value="${p.dir_id}"></td>
        </tr>
        <tr>
            <td>零售价：<input type="number" name="salePrice" value="${p.salePrice}"></td>
            <td>供应商：<input type="text" name="supplier" value="${p.supplier}"></td>
        </tr>
        <tr>
            <td>品牌：<input type="text" name="brand" value="${p.brand}"></td>
            <td>折扣：<input type="number" step="0.01" name="cutoff" value="${p.cutoff}"></td>
        </tr>
        <tr>
            <td>进货价：<input type="number" name="costPrice" value="${p.costPrice}"></td>
        </tr>
        <tr>
            <td><input type="submit" value="确定"></td>
            <td><input type="button" value="取消" onclick="sendTo()"></td>
        </tr>
    </table>
</form>
</body>
</html>
